package com.project.personnel.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.personnel.dao.EmployeeMapper;
import com.project.personnel.entity.Employee;
import com.project.personnel.entity.Employeeec;
import com.project.personnel.service.EmployeeecService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author diaominyh
 * @since 2022-12-12
 */
@RestController
@RequestMapping("/employeeec")
public class EmployeeecController {
    @Resource
    private EmployeeMapper employeeMapper;
    @Resource
    private EmployeeecService employeeecService;
    @PostMapping("/add")
    //员工奖惩添加
    public boolean AddEmployeeec(@RequestBody Employeeec employeeec){
        return employeeecService.save(employeeec);
    }
    @GetMapping("/employeeCha")
    //在输入员工工号后，失去blur隐藏域放入id
    public int idEmployee(@PathVariable String workId){
        QueryWrapper<Employee> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("workId",workId);
        Employee employee=employeeMapper.selectOne(queryWrapper);
        int id=employee.getId();
        return id;
    }
}

